import json

import requests
import time

def del_num():
    # API的URL
    url = 'http://81.70.145.220:7861/ai/knowledge_base/delete_knowledge_base'
    f_list = ['1978']
    # 循环的条件，
    for item in f_list:
        # POST请求的请求体
        payload = json.loads(item)
        # 发起POST请求，并将payload作为JSON数据
        response = requests.post(url, json=payload)
        # 检查响应状态码
        if response.status_code == 200:
            # 解析响应数据
            data = response.json()
            print(data)
        else:
            print(f'状态码：{response.status_code}')
        # 等待一段时间，比如1秒
        time.sleep(1)


if __name__ == '__main__':
    del_num()